home *** CD-ROM | disk | FTP | other *** search
- function movebomb()
- {
- if(lastbx == undefined)
- {
- obx = bx;
- oby = by;
- }
- else
- {
- obx = lastbx;
- oby = lastby;
- }
- bombtrailcount++;
- if(bombtrailcount > bombtraildelay)
- {
- bombtrailcount = 0;
- attachMovie("bombtrail","b" + bombt,bombt);
- bombt++;
- if(bombt > 500)
- {
- bombt = 400;
- }
- }
- if(by < 0)
- {
- this.misslefollow._x = bx;
- }
- else
- {
- this.misslefollow._x = -10;
- }
- temppower -= gravity;
- upv = temppower * Math.sin(radian);
- if(rightv > 0)
- {
- rightv += windamount;
- if(rightv < 0)
- {
- leftv = Math.abs(rightv);
- rightv = 0;
- }
- }
- if(leftv > 0)
- {
- leftv -= windamount;
- if(leftv < 0)
- {
- rightv = Math.abs(leftv);
- leftv = 0;
- }
- }
- bx += rightv;
- bx -= leftv;
- by += upv;
- if(upv == 0)
- {
- upv += 5;
- }
- if(bx > 800)
- {
- bx = 800;
- leftv = rightv;
- rightv = 0;
- }
- if(bx < 0)
- {
- bx = 0;
- rightv = leftv;
- leftv = 0;
- }
- if(by > 600)
- {
- by = 600;
- hity = by;
- lastbx = undefined;
- action = "explode bomb";
- }
- hitarraynum = Math.floor(bx / landdetail);
- hitloc = landarray[hitarraynum];
- if(by >= hitloc)
- {
- hitx = hitarraynum * landdetail;
- hity = hitloc;
- action = "explode bomb";
- }
- if(turn == "player2")
- {
- a = Math.abs(p1x - bx);
- b = Math.abs(p1y - by);
- if(a < 30 && b < 30)
- {
- if(player1shield > 1)
- {
- player1shield--;
- if(explosiontype == 4)
- {
- player1shield = 1;
- }
- shieldfadesound.start();
- }
- else
- {
- player1health -= bombforce;
- }
- hitx = bx;
- hity = by;
- explodesteps = 10;
- moveblast = bombforce / explodesteps;
- blaststeps = moveblast;
- moveblast += blaststeps;
- explodealpha = 100;
- action = "explode bomb";
- }
- }
- else
- {
- a = Math.abs(p2x - bx);
- b = Math.abs(p2y - by);
- if(a < 30 && b < 30)
- {
- if(player2shield > 1)
- {
- player2shield--;
- if(explosiontype == 4)
- {
- player2shield = 1;
- }
- shieldfadesound.start();
- }
- else
- {
- player2health -= bombforce;
- }
- hitx = bx;
- hity = by;
- explodesteps = 10;
- moveblast = bombforce / explodesteps;
- blaststeps = moveblast;
- moveblast += blaststeps;
- explodealpha = 100;
- action = "explode bomb";
- }
- }
- bomb._x = bx;
- bomb._y = by;
- lastbx = bx;
- lastby = by;
- }
- bombt = 400;
- bombtraildelay = 2;
- bombtrailcount = 0;
-